package com.br.util;

import java.util.Enumeration;

import javax.servlet.http.HttpServletRequest;

public class StopUtils {

	public static boolean notEmpty(String value) {
		if (value == null) {
			return false;
		} else if ("".equals(value.trim())) {
			return false;
		} else {
			return true;
		}
	}
	
	public static StringBuilder logAllParameters(HttpServletRequest req){
		
		Enumeration<String> params = req.getParameterNames();
		
		StringBuilder str = new StringBuilder("{");
		while(params.hasMoreElements()){
			String paramName = params.nextElement();
			String paramValue = req.getParameter(paramName);
			
			str.append(paramName);
			str.append(": ");
			str.append(paramValue);
			str.append(", ");
		}
		str.append("}");
		
		return str;
		
	}

}
